<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="error.jsp" %>
<%@ page import="function.Open"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:useBean class="show.Main_show" id="mai" scope="request" />
</head>

<body>
<%
       String name = (String)session.getAttribute("name");
//	   int id = mai.getID().get(mai.getNAME().indexOf(name));
       int id = Integer.parseInt(request.getParameter("id"));
	   Open o = new Open(id);
//	   o.msg(1);
	   int isOpen = Integer.parseInt(request.getParameter("msg"));
	   if(name == null)
	   {
	   out.print("<b style='color:#FF0000'>您的身份认证已经过期，请重新登录！</b>");
	   }
	   else
	   {
	   if(isOpen == 1)
	   {
	   		o.msg(1);
			out.print("<script>window.parent.document.getElementById('openMsg').innerHTML='关闭留言板';</script>");	
			out.print("<script>window.parent.document.getElementById('openMsg').href='msg.jsp?msg=0&id="+id+"';</script>");
			out.print("<script>window.parent.document.getElementById('openMsg').id='closeMsg';</script>");		
			//out.print("<script>setTimeout('window.parent.location.reload()',1000);</script>");			
			out.print("恭喜开通留言板");
	   }
	   else
	   {
	   		o.msg(0);
			out.print("<script>window.parent.document.getElementById('closeMsg').innerHTML='开通留言板';</script>");	
			out.print("<script>window.parent.document.getElementById('closeMsg').href='msg.jsp?msg=1&id="+id+"';</script>");	
			out.print("<script>window.parent.document.getElementById('closeMsg').id='openMsg';</script>");				
			out.print("您已关闭留言板");
	   }
	   }
%>
</body>
</html>
<script language="javascript">
var i = 1;
function Refresh()
{
	var date = new Date();
	var se = date.getSeconds();
	if(se%20=="0")
	{
	    i++;
	}
	if(i==3)
	{
		window.parent.location.reload();
	}
	setTimeout("Refresh()",1000);
	alert("win!");
}
</script>


